#include "application.h"

// Using statements
using std::cin;
using std::cout;
using std::endl;

void print_help_menu(void);

// Application main entry function
int main (int argc, char* argv[])
{
	// Check if user asked for help menu
	if ((argc == 2) && (strcmp(argv[1], "-h") == 0))
		print_help_menu();
	// Verify enough args given
	else if (argc < 3)
		cout << "\nUsage: jsp [option] [file]\nUse the -h option for help" << endl;
	// Do program
	else
	{
		// To do: open tree passed from argv[2]
		cout << "\nOpening \"" << argv[2] << "\"\n";

		// To do: print on -p, generate on -c
		if (strcmp(argv[1], "-c") == 0)
			cout << "Generating code" << endl;
		else if (strcmp(argv[1], "-p") == 0)
			cout << "Printing tree" << endl;
		else
			cout << "Invalid option given" << endl;
	}

	return 0;
}

void print_help_menu(void)
{
	cout << "\nOptions menu for jsp:\n";
	cout << "-p\tPrint tree\n-c\tGenerate source code" << endl;
}